﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using BSU.GraduateWork.BL;
using BSU.Math.Algebra;

namespace BSU.GraduateWork.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            var method = new GridFreeMethod(1000, 0, 1, 0, 1, 0, 1, 0, 0.0001, 0.3, 0.00001);
            method.Solve();

            Console.WriteLine(method.Problem.Solution.IterationsCount);
        }

        //private static Func<double, double, double, double> f = (Func<double, double, double, double>)((Expression<Func<double, double, double, double>>)
        //    ((x, y, z, u) =>
        //       -2 * (y * (1 - y) * z * (1 - z) + x * (1 - x) * z * (1 - z) + x * (1 - x) * y * (1 - y))
        //    )).Compile();

        public static double F(double x, double y, double z)
        {
            return -2*(y*(1 - y)*z*(1 - z) + x*(1 - x)*z*(1 - z) + x*(1 - x)*y*(1 - y));
        }
    }
}
